home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000095_icon-group-sender _Wed Apr 17 13:49:11 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 17 Apr 1996 17:19:29 MST
  2. Date: Wed, 17 Apr 1996 13:49:11 -0700
  3. Message-Id: <199604172049.NAA10393@dfw-ix3.ix.netcom.com>
  4. X-Sender: bobalex@ix.netcom.com
  5. X-Mailer: Windows Eudora Pro Version 2.1.2
  6. Mime-Version: 1.0
  7. Content-Type: text/plain; charset="us-ascii"
  8. To: swampler@noao.edu, icon-group@cs.arizona.edu
  9. From: Bob Alexander <bobalex@ix.netcom.com>
  10. Subject: Re: Making a list out of a generated sequence
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: O
  13.  
  14. >    every tempList := put([], !"string")
  15.  
  16. That is a VERY COOL Icon idiom -- wish I'd thought of it!
  17.  
  18. It consumes a bit of time though, so for cases where that is bad the
  19. old-fashioned way is better.  I did some trivial timings of
  20.  
  21.   every x := put([],1 to 500000)
  22.  
  23.     vs.
  24.  
  25.   x := []; every put(x,1 to 500000)
  26.  
  27. and came out with about 7.5 vs. 5.7 sec -- apparently the cost of doing 1/2M
  28. assignments.  Not that I'm likely to actually *notice* that in a real program...
  29.  
  30. -- Bob
  31.  
  32.